<?php

class tx_zboard_viewhelper_profileLink extends tx_zlib_abstract_viewhelper
{

	public function profileLink($uid, $author)
	{
	    $uid = intval($uid);
	    $author = trim($author);
	    if(($uid > 0) && !empty($author)) {
    	    $profilePid = intval($this->getHelper()->config('profilePid'));
    	    if($profilePid > 0) {
                return $this->getHelper()->link($author, array('action' => 'profile', 'uid' => $uid), true, true, $profilePid);
    	    } else {
    	       return $author;
    	    }
	    }
	    return 'Error: Unvalid ID or author name in profileLink viewhelper';

	}

}


if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/zboard/scripts/helpers/class.tx_zboard_viewhelper_profileLink.php']) {
	include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/zboard/scripts/helpers/class.tx_zboard_viewhelper_profileLink.php']);
}
